﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>网站基本设置 - 问题管理</title>
<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/js/jspublic.js" type="text/javascript"></script>
<script src="js/easyui/jquery.easyui.js" type="text/javascript"></script>
<script src="js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<link href="style/right.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">

	$(function(){
		
		if (window.frameElement == null) self.location = '/manage';
	
		$('.Update').window({
			modal:true,
			closed:true,
			collapsible:false,
			minimizable:false,
			maximizable:false,
			closable:true,
			draggable:false,
			resizable:false,
			inline:false
		});
	
		$('#MyDataGrid').datagrid({
			scrollbarSize: 0,
			fitColumns: true,
			resizable: false,
			checkOnSelect: false
		});
	
		$(window).resize(function(){
			$("#MyDataGrid").datagrid("resize");
		});
		
		$('.edit').bind('click', function(){
			var id = $(this).attr('aid');
			var dname = $(this).attr('dname');
			var aurl = "admin_update.aspx?T=" + dname + "&id=" + id;
			if(id!=""&&id!=null){
				switch(dname)
				{
					case "b_ask_class":
					    $('#form2').attr('action', aurl);
					    $('#form2 option[value=' + $(this).attr('cid') + ']').attr("selected", true);
						$('#' + dname).window('open');
						break;
					case "b_ask_audit":
						$('#form3').attr('action',aurl);
						if($(this).attr('audit')==0){
					    	$('#form3 input[type=radio][value=1]').attr("checked", true);
						}
						else {
							$('#form3 input[type=radio][value=0]').attr("checked", true);
						}
						$('#form3').submit();
						break;
					case "b_ask_recommend":
						$('#form4').attr('action',aurl);
						$('#' + dname).window('open');
						break;
					case "b_ask_remm":
					    $('#form5').attr('action', aurl);
						if($(this).attr('remm')==2){
					    	$('#form5 input[type=radio][value=0]').attr("checked", true);
						}
						else {
							$('#form5 input[type=radio][value=2]').attr("checked", true);
						}
						$('#form5').submit();
						break;
					default:
						break;
				}
			}			
		});
	
	});
	
	function reloadGrid() {
		$('#MyDataGrid').datagrid('reload');
	}
	
</script>
</head>

<body>
<div class="zs_content">

	<div class="zs_quota">
		<h4>网站基本设置 - 问题管理</h4>
	</div>

	<div class="zs_quota">
        <h1>按分类或者按标题查找：</h1>
        <form action="admin_search.aspx?template=template/t_admin_ask_result.html" method="post" name="formSearch">
            <select name="type">
                <option value="allClass">所有分类</option>
                {liebiao2:B_askClass^0^a_classid asc^a_classLevel=1}
                <optgroup label="【{<a_className>}】">
                {liebiao:B_askClass^0^a_classid asc^a_classLevel=2 and a_parentid={<a_classid>}}
                <option value="{a_classid}">{a_className}</option>
                {/liebiao}
                </optgroup>
                {/liebiao2}
            </select>
            <input type="text" name="keyword" id="keyword" maxlength="50" />
            <input type="submit" name="Submit" value="查找" class="btn btn-primary" />
        </form>
	</div>
    
	<div class="zs_quota">
		<form method="post" name="form1" id="form1">
		<table id="MyDataGrid">
			<thead>
				<tr>
					<th field="checkbox" align="center" data-options="checkbox:true" style="width: 35px;"></th>
					<th field="asktitle" align="left" data-options="fitColumns:true" width="100%">标题</th>
					<th field="askclass" align="center" style="width: 10em;">问题类别</th>
					<th field="askuser" align="center" style="width: 10em;">用户</th>
					<th field="asktime" align="center" style="width: 6em;">提问时间</th>
					<th field="askexamine" align="center" style="width: 35px;">审核</th>
					<th field="del" align="center" style="width: 35px;">删除</th>
				</tr>
			</thead>
			<tbody>
				{fenye:B_ask^15^a_id desc^a_ischeck=1}
				<tr>
					<td align="center">{a_id}</td>
					<td><a class="listtitle" title="{a_title}" href="admin_urls.aspx?template=template/t_admin_ask_info.html&id={a_id}">{a_title}</a></td>
					<td align="center"><a class="edit" aid="{a_id}" dname="b_ask_class" cid="{a_classid}">{g:B_askClass$a_className@a_classid={a_classid}}</a></td>
					<td align="center"><a href="admin_urls.aspx?template=template/t_admin_user_info.html&id={u_id}">{g:B_user$u_nickName@u_id={u_id}}</a></td>
					<td align="center">{a_time}</td>
					<td align="center"><a class="edit easyui-linkbutton" aid="{a_id}" audit="{a_ischeck}" dname="b_ask_audit" {ruguo:{a_ischeck}==0}data-options="iconCls:'icon-unlock'" title="取消审核"{fouze}data-options="iconCls:'icon-lock'" title="审核"{/ruguo}></a></td>
					<td align="center"><a class="easyui-linkbutton" title="删除" href="Admin_del.aspx?T=b_ask&id={a_id}" onclick="javascript:return confirm('确认要删除吗？');" data-options="iconCls:'icon-recycle'"></a></td>
				</tr>
				{/fenye}
			</tbody>
		</table>
		<div class="tools">
        	<div class="pagination pagination-right">
				<ul>{$page}</ul>
            </div>
		</div>
		<div class="tools1">
			<div class="act">
				<input type="submit" value="批量通过" class="btn btn-primary" onclick="submits('admin_update.aspx?T=b_ask_audit');" />
				<input type="submit" value="删除选中" class="btn btn-primary" onclick="submits('Admin_del.aspx?T=b_askall');" />
			</div>
		</div>
		</form>
	</div>
	
</div>

<div style="display:none;">
	<div id="b_ask_class" class="Update" title="修改分类">
		<form id="form2" name="form2" action="" method="post">
            <select name="a_classid" id="a_classid">
                {liebiao2:B_askClass^0^a_classid asc^a_classLevel=1}
                <optgroup label="{<a_className>}">
                    {liebiao:B_askClass^0^a_classid asc^a_classLevel=2 and a_parentid={<a_classid>}}
                    <option value="{a_classid}">——{a_className}</option>
                    {/liebiao}{/liebiao2}
                </optgroup>
            </select>
            <input type="submit" value="提交" class="btn btn-primary" />
		</form>
	</div>
	
	<div id="b_ask_audit" class="Update" title="问题审核">
		<form id="form3" name="form3" action="" method="post">
		<ul>
			<li>
				<label>审核：</label>
				<input type="radio" name="a_ischeck" value="0" checked /><span>通过</span>
				<input type="radio" name="a_ischeck" value="1" /><span>未通过</span>
			</li>
			<li>
				<input type="submit" value="提交" class="btn btn-primary" />
				<input type="button" value="取消" class="btn btn-primary" onclick="$('#b_ask_audit').window('close');" />
			</li>
		</ul>
		</form>
	</div>
	
	<div id="b_ask_recommend" class="Update" title="设置专题名称">
		<form id="form4" name="form4" action="" method="post">
            <input class="input-small" type="text" name="a_mtitle" />
            <input type="submit" value="提交" class="btn btn-primary" />
		</form>
	</div>
	
	<div id="b_ask_remm" class="Update" title="问题推荐">
		<form id="form5" name="form5" action="" method="post">
		<ul>
			<li>
				<label>是否推荐：</label>
				<input type="radio" name="a_recommend" value="2" checked /><span>是</span>
				<input type="radio" name="a_recommend" value="0" /><span>否</span>
			</li>
			<li>
				<input type="submit" value="提交" class="btn btn-primary" />
				<input type="button" value="取消" class="btn btn-primary" onclick="$('#b_ask_remm').window('close');" />
			</li>
		</ul>
		</form>
	</div> 
</div>


</body>
</html>